package com.boyon.common.action;

import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.boyon.common.domain.Value;
import com.boyon.common.status.AccountType;
import com.boyon.common.status.CodingType;
import com.boyon.common.status.ConfigType;
import com.boyon.common.status.ContainerType;
import com.boyon.common.status.CustomerCategoryType;
import com.boyon.common.status.CustomerType;
import com.boyon.common.status.InvoiceType;
import com.boyon.common.status.LimitType;
import com.boyon.common.status.MenuType;
import com.boyon.common.status.PayType;
import com.boyon.common.status.PreffixType;
import com.boyon.common.status.RateType;
import com.boyon.common.status.RelationType;
import com.boyon.common.status.ReportType;
import com.boyon.common.status.RoleType;
import com.boyon.common.status.SettlementType;
import com.boyon.common.status.StatusType;
import com.boyon.common.status.SystemType;
import com.boyon.web.param.annotation.ValidatorRequestBody;
import com.boyon.web.response.AbstractResponse;
import com.boyon.web.response.FailResponse;
import com.boyon.web.response.SuccessResponse;

/**
 * ClassName:EnmuAction <br/>
 * Function: 枚举类型请求action. <br/>
 * Date: 2018年3月27日 下午9:52:55 <br/>
 * 
 * @author sunshulin
 * @version
 * @since JDK 1.8
 * @see
 */
@Controller
@RequestMapping(value = "/beyon/enmu", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class EnmuAction {

	/**
	 * 
	 * getEnmu:查询系统常量数据. <br/>
	 * 
	 * @author sunshulin
	 * @param value
	 * @return
	 * @since JDK 1.8
	 */
	@RequestMapping(value = "/type")
	@ResponseBody
	public AbstractResponse getEnmu(@ValidatorRequestBody Value value) {
		Integer type = value.getType();
		switch (type) {
			case 0:
				return new SuccessResponse(AccountType.getList());
			case 1:
				return new SuccessResponse(CodingType.getList());
			case 2:
				return new SuccessResponse(ConfigType.getList());
			case 3:
				return new SuccessResponse(ContainerType.getList());
			case 4:
				return new SuccessResponse(LimitType.getList());
			case 5:
				return new SuccessResponse(MenuType.getList());
			case 6:
				return new SuccessResponse(RoleType.getList());
			case 7:
				return new SuccessResponse(StatusType.getList());
			case 8:
				return new SuccessResponse(SystemType.getList());
			case 9:
				return new SuccessResponse(RelationType.getList());
			case 10:
				return new SuccessResponse(PreffixType.getList());
			case 11:
				return new SuccessResponse(CustomerType.getList());
			case 12:
				return new SuccessResponse(PayType.getList());
			case 13:
				return new SuccessResponse(SettlementType.getList());
			case 14:
				return new SuccessResponse(InvoiceType.getList());
			case 15:
				return new SuccessResponse(CustomerCategoryType.getList());
			case 16:
				return new SuccessResponse(RateType.getList());
			case 17:
				return new SuccessResponse(ReportType.getList());
		}
		return new FailResponse("未知数据类型");
	}
}
